
var express = require('express');
var productRouter = express.Router();
const productController = require('../../controller/admin/productController')

//图片上传
const multer = require('multer')
const upload = multer({ dest: 'public/productuploads/' })


productRouter.post('/adminapi/product/add', upload.single('file'), productController.add);

productRouter.get('/adminapi/product/list', productController.getList);

productRouter.get('/adminapi/product/list/:id', productController.getList);

productRouter.post('/adminapi/product/list', upload.single('file'), productController.updateList);

productRouter.delete('/adminapi/product/list/:id', productController.delList);



module.exports = productRouter